package com.zhpan.idea.net.interceptor;

import java.io.IOException;

import okhttp3.Interceptor;
import okhttp3.Request;
import okhttp3.Response;

/**
 * Created by  on 2021/3/18
 */


public class HttpHeaderInterceptor implements Interceptor {
    @Override
    public Response intercept(Chain chain) throws IOException {
        //  配置请求头
        String token = "token";
        Request request = chain.request().newBuilder()
                .header("Accept", "*/*")
                .header("Content-Type", "application/json")
                .header("token", token)
                .build();
        return chain.proceed(request);
    }
}
